<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>some</title>
</head>

<body>
    <input type="text" name="title" />
    <span></span>
</body>
<script>
    let keywords = ["php", "js"];
    let title = document.querySelector('[name="title"]');
    title.addEventListener("keyup", function () {
        const res = keywords.some(keyword => {
            return this.value.indexOf(keyword) != -1;
        });
        document.querySelector("span").innerHTML = res ? "" : "必须包含" + keywords.join(",") + "关键字";
    });
</script>

</html>